import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { SGuildMemberCallBack } from "../../../../../Message/Game/SGuildMemberCallBack";
import { AvatarInfo } from "../../../resource/info/AvatarInfo";
import { AvatarType } from "../../../resource/info/AvatarType";
import { ImageInfo } from "../../../../../com/gengine/resource/info/ImageInfo";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../../extend/language/Language";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class LeagueRecallItemRenderer
    
    export  class LeagueRecallItemRenderer extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var arg0: Object;
            var item: SGuildMemberCallBack;
            var imgName: string;

            var loc1;
            item = null;
            arg0 = arg1;
            super.data = arg0;
            item = data as SGuildMemberCallBack;
            imgName = AvatarInfo.getPlayerAvatarName(item.member.camp, item.member.sex, AvatarType.FRIEND, item.member.avatarId);
            with ({}) 
            {
            };
            imgName.load(
#error('pushwith') {}
            , 
#error('pushwith') {}
            .onAvatarLoaded = (arg1: ImageInfo): void
            {
                _avatarBitmap.bitmapData = arg1.bitmapData;
                _avatarBitmap.width = 20;
                _avatarBitmap.height = 20;
                _avatarBitmap.filters = item.member.online != 1 ? [FilterConst.colorFilter2] : [];
                return;
            })
            this._levelText.text = item.member.level.toString();
            this._name.text = item.member.name;
            if (item.isBack) 
            {
                this._stateText.htmlText = HTMLUtil.addColor(Language.getString(27734), "#00FF00");
            }
            else 
            {
                this._stateText.htmlText = HTMLUtil.addColor(Language.getString(27733), GlobalStyle.color1);
            }
            return;
        }

        protected /* override */ createChildren(): void
        {
            this._avatarBitmap = new Object /* flash.display.Bitmap */();
            ObjCreate.setObjAttri(this._avatarBitmap, 24, 2, 20, 20, this);
            this._levelText = ObjCreate.createGTextField("", 175, 2, 30, 20, this);
            this._name = ObjCreate.createGTextField("", 50, 2, 160, 20, this);
            this._stateText = ObjCreate.createGTextField("", 215, 2, 40, 20, this);
            ObjCreate.createBg(10, 25, 270, 3, this, ImagesConst.SplitLine);
            return;
        }

        /* internal */ /* var */_avatarBitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_name: GTextFiled;

        /* internal */ /* var */_levelText: GTextFiled;

        /* internal */ /* var */_stateText: GTextFiled;
    }
